import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  // 路由重定向
  { path: '/', redirect: '/view' },
  { path: '/home', component: () => import('@/views/MyHome.vue') },
  { path: '/view', component: () => import('@/views/myView.vue') },
  { path: '/test', component: () => import('@/views/MyTest.vue') },
  { path: '/demo', component: () => import('@/components/Demo2.vue') }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
